Add a GENERATE_PS capability. And use it here.
authorMatthias Clasen <mclasen@redhat.com>
Mon, 19 Jun 2006 04:21:22 +0000 (04:21 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 19 Jun 2006 04:21:22 +0000 (04:21 +0000)
2006-06-19  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkprintjob.h: Add a GENERATE_PS capability.
* gtk/gtkprintunixdialog.c (is_printer_active): And use it here.

ChangeLog
ChangeLog.pre-2-10
gtk/gtkprintjob.h
gtk/gtkprintunixdialog.c

index 69affb2a02bef9e622e44c7466a3a507a83139e6..66228eb2031678b598aa3c20a053a6e2b69c0255 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-06-19  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkprintjob.h: Add a GENERATE_PS capability. 
+       * gtk/gtkprintunixdialog.c (is_printer_active): And use it here.
+
 2006-06-18  Matthias Clasen  <mclasen@redhat.com>
 
        * tests/testnouiprint.c (main): Don't open a display connection.
index 69affb2a02bef9e622e44c7466a3a507a83139e6..66228eb2031678b598aa3c20a053a6e2b69c0255 100644 (file)
@@ -1,3 +1,8 @@
+2006-06-19  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkprintjob.h: Add a GENERATE_PS capability. 
+       * gtk/gtkprintunixdialog.c (is_printer_active): And use it here.
+
 2006-06-18  Matthias Clasen  <mclasen@redhat.com>
 
        * tests/testnouiprint.c (main): Don't open a display connection.
index 5273c856d01184b758e57b2c34a0ca9ee8320da8..ae71832a9a772e57862b30b84d49b05aca37d04f 100644 (file)
@@ -41,7 +41,8 @@ typedef enum
   GTK_PRINT_CAPABILITY_COLLATE      = 1 << 2,
   GTK_PRINT_CAPABILITY_REVERSE      = 1 << 3,
   GTK_PRINT_CAPABILITY_SCALE        = 1 << 4,
-  GTK_PRINT_CAPABILITY_GENERATE_PDF = 1 << 5
+  GTK_PRINT_CAPABILITY_GENERATE_PDF = 1 << 5,
+  GTK_PRINT_CAPABILITY_GENERATE_PS  = 1 << 6
 } GtkPrintCapabilities;
 
 typedef struct _GtkPrintJob          GtkPrintJob;
index b81de906db48f9291810724a120e997abb7bc1f1..ee10433e067fb4412f7f31dfe9b20fda3bfc3a06 100644 (file)
@@ -573,10 +573,17 @@ is_printer_active (GtkTreeModel       *model,
 
   result = gtk_printer_is_active (printer);
   
-  if (result)
+  if (result && 
+      priv->manual_capabilities & (GTK_PRINT_CAPABILITY_GENERATE_PDF |
+                                  GTK_PRINT_CAPABILITY_GENERATE_PS))
     {
-      if ((priv->manual_capabilities & GTK_PRINT_CAPABILITY_GENERATE_PDF) == 0)
-       result = gtk_printer_accepts_ps (printer);
+       /* Check that the printer can handle at least one of the data 
+       * formats that the application supports.
+        */
+       result = ((priv->manual_capabilities & GTK_PRINT_CAPABILITY_GENERATE_PDF) &&
+                gtk_printer_accepts_pdf (printer)) ||
+               ((priv->manual_capabilities & GTK_PRINT_CAPABILITY_GENERATE_PS) &&
+                gtk_printer_accepts_ps (printer));
     }
   
   g_object_unref (printer);
@@ -1148,7 +1155,7 @@ clear_per_printer_ui (GtkPrintUnixDialog *dialog)
   gtk_container_foreach (GTK_CONTAINER (priv->advanced_vbox),
                         (GtkCallback)gtk_widget_destroy,
                         NULL);
-  extension_point_clear_children (priv->extension_point);
+  extension_point_clear_children (GTK_CONTAINER (priv->extension_point));
 }
 
 static void
@@ -1244,7 +1251,7 @@ selected_printer_changed (GtkTreeSelection   *selection,
     {
       priv->printer_capabilities = _gtk_printer_get_capabilities (printer);
       priv->options = _gtk_printer_get_options (printer, priv->initial_settings,
-                                                       priv->page_setup);
+                                               priv->page_setup);
   
       priv->options_changed_handler = 
         g_signal_connect_swapped (priv->options, "changed", G_CALLBACK (options_changed_cb), dialog);